\(\int \frac {(f+g x)^n (a+2 c d x+c e x^2)}{(d+e x)^2} \, dx\) [810]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F(-2)]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 28, antiderivative size = 88 \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\frac {c (f+g x)^{1+n}}{e g (1+n)}-\frac {\left (c d^2-a e\right ) g (f+g x)^{1+n} \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g)^2 (1+n)} \]

[Out]

c*(g*x+f)^(1+n)/e/g/(1+n)-(c*d^2-a*e)*g*(g*x+f)^(1+n)*hypergeom([2, 1+n],[2+n],e*(g*x+f)/(-d*g+e*f))/e/(-d*g+e
*f)^2/(1+n)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {961, 70} \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\frac {c (f+g x)^{n+1}}{e g (n+1)}-\frac {g \left (c d^2-a e\right ) (f+g x)^{n+1} \operatorname {Hypergeometric2F1}\left (2,n+1,n+2,\frac {e (f+g x)}{e f-d g}\right )}{e (n+1) (e f-d g)^2} \]

[In]

Int[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x]

[Out]

(c*(f + g*x)^(1 + n))/(e*g*(1 + n)) - ((c*d^2 - a*e)*g*(f + g*x)^(1 + n)*Hypergeometric2F1[2, 1 + n, 2 + n, (e
*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g)^2*(1 + n))

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/(b^(
n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 961

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (E
qQ[m, -2] && EqQ[p, 1] && EqQ[2*c*d - b*e, 0]))

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {c (f+g x)^n}{e}+\frac {\left (-c d^2+a e\right ) (f+g x)^n}{e (d+e x)^2}\right ) \, dx \\ & = \frac {c (f+g x)^{1+n}}{e g (1+n)}+\frac {\left (-c d^2+a e\right ) \int \frac {(f+g x)^n}{(d+e x)^2} \, dx}{e} \\ & = \frac {c (f+g x)^{1+n}}{e g (1+n)}-\frac {\left (c d^2-a e\right ) g (f+g x)^{1+n} \, _2F_1\left (2,1+n;2+n;\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g)^2 (1+n)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.94 \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\frac {(f+g x)^{1+n} \left (c (e f-d g)^2+\left (-c d^2+a e\right ) g^2 \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {e (f+g x)}{e f-d g}\right )\right )}{e g (e f-d g)^2 (1+n)} \]

[In]

Integrate[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x]

[Out]

((f + g*x)^(1 + n)*(c*(e*f - d*g)^2 + (-(c*d^2) + a*e)*g^2*Hypergeometric2F1[2, 1 + n, 2 + n, (e*(f + g*x))/(e
*f - d*g)]))/(e*g*(e*f - d*g)^2*(1 + n))

Maple [F]

\[\int \frac {\left (g x +f \right )^{n} \left (c e \,x^{2}+2 c d x +a \right )}{\left (e x +d \right )^{2}}d x\]

[In]

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x)

[Out]

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x)

Fricas [F]

\[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\int { \frac {{\left (c e x^{2} + 2 \, c d x + a\right )} {\left (g x + f\right )}^{n}}{{\left (e x + d\right )}^{2}} \,d x } \]

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="fricas")

[Out]

integral((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e^2*x^2 + 2*d*e*x + d^2), x)

Sympy [F(-2)]

Exception generated. \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\text {Exception raised: HeuristicGCDFailed} \]

[In]

integrate((g*x+f)**n*(c*e*x**2+2*c*d*x+a)/(e*x+d)**2,x)

[Out]

Exception raised: HeuristicGCDFailed >> no luck

Maxima [F]

\[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\int { \frac {{\left (c e x^{2} + 2 \, c d x + a\right )} {\left (g x + f\right )}^{n}}{{\left (e x + d\right )}^{2}} \,d x } \]

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="maxima")

[Out]

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d)^2, x)

Giac [F]

\[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\int { \frac {{\left (c e x^{2} + 2 \, c d x + a\right )} {\left (g x + f\right )}^{n}}{{\left (e x + d\right )}^{2}} \,d x } \]

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="giac")

[Out]

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d)^2, x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\int \frac {{\left (f+g\,x\right )}^n\,\left (c\,e\,x^2+2\,c\,d\,x+a\right )}{{\left (d+e\,x\right )}^2} \,d x \]

[In]

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x)

[Out]

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2, x)